import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'
import Login from '@/views/Login.vue'
import Register from '@/views/Register'
import PageWrap from '@/views/PageWrap'
import Details from '@/views/Details'
import notFound from '@/views/notFound'
import SearchResult from '@/views/SearchResult'
import Me from '@/views/Me'
import myInfo from '@/views/MyInfo'
import Addrelease from '@/views/Addrelease'
import MyGiveup from '@/views/MyGiveup'
import MyCollent from '@/views/MyCollent'
import MySend from '@/views/MySend'


Vue.use(VueRouter)


const router = new VueRouter({
    routes: [
        {
            path: '/',
            redirect: "/home",
            component: PageWrap,
            children: [
                {
                    path: "/home",
                    component: Home,
                },
                {
                    path: "/blogDetails",
                    component: Details,
                },
                {
                    path:"/searchResult",
                    component:SearchResult
                },
                {
                    path:'/about',
                    component:Me,
                    redirect:"/me",
                    children:[
                        {
                            path:"/me",
                            component:myInfo
                        },
                        {
                            path:"/Addrelease",
                            component:Addrelease
                        },
                        {
                            path:"/myCollent",
                            component:MyCollent
                        },
                        {
                            path:"/myGiveup",
                            component:MyGiveup
                        },
                        {
                            path:"/mySend",
                            component:MySend
                        }
                    ]
                }
            ]
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: "/register",
            component: Register
        },
        {
            path: "/notFound",
            component: notFound
        },
        {
            path:"*",
            redirect:'/notFound'
        }
    ]
})

export default router